 using System.Windows;
using Microsoft.Practices.Prism.Modularity;
using Microsoft.Practices.Prism.UnityExtensions;

namespace compshop.Desktop
{
    /// <summary>
    /// регистрация модулей, загрузка шелла
    /// </summary>
    class Bootstrapper: UnityBootstrapper
    {
        protected override DependencyObject CreateShell()
        {
            return new Shell();
        }

        protected override void InitializeShell()
        {
            base.InitializeShell();

            App.Current.MainWindow = (Window)this.Shell;
            App.Current.MainWindow.Show();
        }

        protected override void ConfigureModuleCatalog()
        {
            base.ConfigureModuleCatalog();
            ModuleCatalog moduleCatalog = (ModuleCatalog)this.ModuleCatalog;            
            moduleCatalog.AddModule(typeof(compshop.Modules.Categories.CategoriesModule));
            moduleCatalog.AddModule(typeof(compshop.Modules.GeneralProducts.GeneralProductsModule));
            moduleCatalog.AddModule(typeof(compshop.Modules.Producers.ProducersModule));
            moduleCatalog.AddModule(typeof(compshop.Modules.ClientOrderList.ClientOrderListModule));
            moduleCatalog.AddModule(typeof(compshop.Modules.GeneralProductParameters.GeneralProductParametersModule));
            
            moduleCatalog.AddModule(typeof(compshop.Modules.ReceiveGoods.ReceiveGoodsModule));
            moduleCatalog.AddModule(typeof(compshop.Modules.OrdersToSupplier.OrdersToSupplierModule));

            moduleCatalog.AddModule(typeof(compshop.Modules.PositionList.PositionListModule));
            moduleCatalog.AddModule(typeof(compshop.Modules.ListOfSuppliers.SuppliersListModule));
            moduleCatalog.AddModule(typeof(compshop.Modules.ListOfEmployees.EmployeeListModule));
            moduleCatalog.AddModule(typeof(compshop.Modules.DepartmentList.DepartmentListModule));

            moduleCatalog.AddModule(typeof(compshop.Modules.ClientOrderEdit.ClientOrderEditModule));
            moduleCatalog.AddModule(typeof(compshop.Modules.ListOfGoodsInWaybill.GoodsListInWaybillModule));
            moduleCatalog.AddModule(typeof(compshop.Modules.ListOfTransportationBills.TransportationBillsListModule));
            moduleCatalog.AddModule(typeof(compshop.Modules.ListOfWaybills.WaybillListModule));
        }


    }   //class Bootstrapper
}
